#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  first.py
#       Author @  Huoty
#  Create date @  2016-05-26 13:58:30
#  Description @  
# *************************************************************

import sys
import logbook

logbook.StreamHandler(sys.stdout, level='INFO').push_application()
logbook.StderrHandler(level='ERROR').push_application()

# 屏蔽print输出
class OutStream(object):
    def __init__(self, delegate):
        self.delegate = delegate
    def write(self, msg):
        # 去掉多余的空行
        if msg.strip():
            self.delegate(msg)
        pass
    def flush(self):
        pass

sys.stdout = OutStream(logbook.info)
sys.stderr = OutStream(logbook.warn)

# Script starts from here

print type(1)
